<%@page import="com.ia.uniweb.model.Result"%>
<%@page import="java.util.List"%>

<html>
<body>
	<div>
		<h2>Uniweb results information</h2>

		<%
			List<Result> results = (List<Result>) request
					.getAttribute("result-result");
			if (results != null) {
		%>
		
		<div>Results for <span style="font-weight: bold;"><%= results.get(0).getRegistrationNumber() %></span></div>		
			
		<table>
			
			<thead>	
				<tr>
					<th>Subject </th>
					<th>Internal Assessment </th>
					<th>Practicals </th>
					<th>Theory </th>
					<th>Grade </th>
					<th>Result </th>
				</tr>
			</thead>
		<%		
				for (int i = 0; i < results.size(); i++) {
		%>
				<tr>
					<td><%= results.get(i).getSubject() %></td>
					<td><%= results.get(i).getInternalMarks() %></td>
					<td><%= results.get(i).getPracticalMarks() %></td>
					<td><%= results.get(i).getTheoryMarks() %></td>
					<td><%= results.get(i).getGrade() %></td>
					<td><%= results.get(i).getResult() %></td>
				</tr>

		<%
			}
		%>
		
			</table>
		
		<%
			} else {
		%>
		
			<div><span> No results found for your search! </span></div>	
		
		<% 
			} 
		%>

	</div>
</body>
</html>